﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="sms_info_about.aspx.vb" Inherits="webfinancegdrassign4.sms_info_about" %>

<%--Smart Money $aver Project for University of Herts--%>
<%--Date: 01 December 2013--%>
<%--Version 1--%>
<%--Project Brief Description - This is a Smart Money Saver asp.net product using VB.net. It is intended to be used by Smart Money Savers who want to make and save money and earn and save a certain amount to benefit--%>
<%--Program Brief Description - This is the main Site.Master file. All change appear on all pages. This is a standard program from a default build from setting up the project in Visual Studio --%>
<%--Changes - Added an image for the Smart Investor program / website --%>
<%--Changes - Changed original Texts to 'Smart Money $aver ' --%>

<%--Update 1 -  5th Jan 2014 - sms_info_contact_info.aspx enabled page to allow admin user to update,delete and select data from Table --%>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        function newPopup1(url) {
            popupWindow = window.open(
            url, 'popUpWindow', 'height=450,width=1000,left=200,top=20,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
        }






    </script>



    <asp:UpdatePanel ID="MyUpdatePanel" runat="server">
        <ContentTemplate>

            <div class="hero-unit">
                 <script type="text/javascript">
                    function GetFile() {
                        var fileinput = document.getElementById('<%=fl1.ClientID%>');
                        var textinput = document.getElementById('<%=txtfl1.ClientID%>');
                        textinput.value = fileinput.value;
                    }
                    function GetFile2() {
                        var fileinput = document.getElementById('<%=fl2.ClientID%>');
                        var textinput = document.getElementById('<%=txtfl2.ClientID%>');
                        textinput.value = fileinput.value;
                    }
                    function GetFile3() {
                        var fileinput = document.getElementById('<%=fl3.ClientID%>');
                        var textinput = document.getElementById('<%=txtfl3.ClientID%>');
                        textinput.value = fileinput.value;
                    }
                    function GetFile4() {
                        var fileinput = document.getElementById('<%=fl4.ClientID%>');
                        var textinput = document.getElementById('<%=txtfl4.ClientID%>');
                        textinput.value = fileinput.value;
                    }
                    function GetFile5() {
                        var fileinput = document.getElementById('<%=fl5.ClientID%>');
                        var textinput = document.getElementById('<%=txtfl5.ClientID%>');
                        textinput.value = fileinput.value;
                    }
                    function GetFile6() {
                        var fileinput = document.getElementById('<%=fl6.ClientID%>');
                        var textinput = document.getElementById('<%=txtfl6.ClientID%>');
                        textinput.value = fileinput.value;
                    }
                </script>

                <div class="row-fluid">
                    <div id='cssmenu'>
                        <ul>
                            <li><a href="sms_comments.aspx"><span>  Comments</span></a></li>
                            <li class='active'><a href="sms_info_about.aspx"><span>  Info About</span></a></li>
                            <li><a href="sms_money_data.aspx"><span>  Money Data</span></a></li>
                            <li><a href="sms_moneyjunction.aspx"><span>  Money Junction</span></a></li>
                            <li><a href="sms_moneytype.aspx"><span>  Money Type</span></a></li>
                            <li><a href="sms_tags.aspx"><span>  Tags</span></a></li>
                            <li><a href="sms_type.aspx"><span>User Type</span></a></li>
                        </ul>
                    </div>
                    <div style="margin-top: 10px;">

                        <%--<input type="button" value="Add Comments" class="button" style="float: right; width: 116px;" onclick="return window.open('AddComment.aspx', 'mywindow', 'menubar=1,resizable=1,width=650,height=400,top=100,left=400');" />--%>
                    </div>
                </div>
                <hgroup></hgroup>

                <h2 style="color: #999;">Edit Contact Information<asp:Button runat="server" ID="btnAddComments" Text="Add Sms Info" CssClass="button" Style="float: right; width: 116px;" OnClientClick="JavaScript:newPopup1('AddInfoAbout.aspx');" /></h2>

                <div class="head-2">
                    <asp:GridView ID="GridView1" CssClass="Grid" runat="server" DataSourceID ="SqlDataSource005" AutoGenerateColumns="False" DataKeyNames="ID" AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowEditing="GridView1_RowEditing" OnRowDeleting="GridView1_RowDeleting" OnPageIndexChanging="GridView1_PageIndexChanging" Width="100%">
                        <AlternatingRowStyle BackColor="White"  />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <itemstyle width="5%" />
                                    <asp:ImageButton ID="imgdelete" runat="server" CommandName="Delete" ToolTip="Delete" CausesValidation="false" Width="25" OnClientClick="return confirm('Do you want to Delete this Recored')" ImageUrl="~/img/Delete.png" />
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField>
                                <ItemTemplate>
                                    <itemstyle width="5%" />
                                    <asp:ImageButton ID="imgEdit" runat="server" CommandName="Edit" CausesValidation="false" ToolTip="Edit" Width="25" ImageUrl="~/img/1leftarrow.png" />
                                </ItemTemplate>

                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="About Website">
                                <ItemStyle Width="15%" />
                                <ItemTemplate>

                                    <%# DataBinder.Eval(Container.DataItem, "about_website")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contact Website">
                                <ItemStyle Width="15%" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "contact_website")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="About Image 1">
                                <ItemStyle Width="10%" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "about_image1")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="About Image 2">
                                <ItemStyle Width="10%" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "about_image2")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="About Image 3">
                                <ItemStyle Width="10%" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "about_image3")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="About Image 4">
                                <ItemStyle Width="10%" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "about_image4")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="About Image 5">
                                <ItemStyle Width="10%" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "about_image5")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="About Image 6">
                                <ItemStyle Width="10%" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "about_image6")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField Visible="false">
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "ID")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>



                        <EditRowStyle BackColor="#FFFF99" />

                        <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle HorizontalAlign="Left" />
                        <RowStyle BackColor="#EFF3FB" />

                        <SelectedRowStyle Font-Bold="True" ForeColor="#FFFF99" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />

                    </asp:GridView>
                </div>
                <asp:SqlDataSource ID="SqlDataSource005" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString006 %>" ProviderName="<%$ ConnectionStrings:ConnectionString006.ProviderName %>" SelectCommand="SELECT [ID], [about_website], [contact_website], [about_image1], [about_image2], [about_image3], [about_image4], [about_image5], [about_image6] FROM [sms_info] " OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues" InsertCommand="INSERT INTO [sms_info] ([ID], [about_website], [contact_website], [about_image1], [about_image2], [about_image3], [about_image4], [about_image5], [about_image6]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" DeleteCommand="DELETE FROM [sms_info] WHERE [ID] = ? AND (([about_website] = ?) OR ([about_website] IS NULL AND ? IS NULL)) AND (([contact_website] = ?) OR ([contact_website] IS NULL AND ? IS NULL)) AND (([about_image1] = ?) OR ([about_image1] IS NULL AND ? IS NULL)) AND (([about_image2] = ?) OR ([about_image2] IS NULL AND ? IS NULL)) AND (([about_image3] = ?) OR ([about_image3] IS NULL AND ? IS NULL)) AND (([about_image4] = ?) OR ([about_image4] IS NULL AND ? IS NULL)) AND (([about_image5] = ?) OR ([about_image5] IS NULL AND ? IS NULL)) AND (([about_image6] = ?) OR ([about_image6] IS NULL AND ? IS NULL))" UpdateCommand="UPDATE [sms_info] SET [about_website] = ?, [contact_website] = ?, [about_image1] = ?, [about_image2] = ?, [about_image3] = ?, [about_image4] = ?, [about_image5] = ?, [about_image6] = ? WHERE [ID] = ? AND (([about_website] = ?) OR ([about_website] IS NULL AND ? IS NULL)) AND (([contact_website] = ?) OR ([contact_website] IS NULL AND ? IS NULL)) AND (([about_image1] = ?) OR ([about_image1] IS NULL AND ? IS NULL)) AND (([about_image2] = ?) OR ([about_image2] IS NULL AND ? IS NULL)) AND (([about_image3] = ?) OR ([about_image3] IS NULL AND ? IS NULL)) AND (([about_image4] = ?) OR ([about_image4] IS NULL AND ? IS NULL)) AND (([about_image5] = ?) OR ([about_image5] IS NULL AND ? IS NULL)) AND (([about_image6] = ?) OR ([about_image6] IS NULL AND ? IS NULL)) ">
                    <DeleteParameters>
                        <asp:Parameter Name="original_ID" Type="Int32" />
                        <asp:Parameter Name="original_about_website" Type="String" />
                        <asp:Parameter Name="original_about_website" Type="String" />
                        <asp:Parameter Name="original_contact_website" Type="String" />
                        <asp:Parameter Name="original_contact_website" Type="String" />
                        <asp:Parameter Name="original_about_image1" Type="String" />
                        <asp:Parameter Name="original_about_image1" Type="String" />
                        <asp:Parameter Name="original_about_image2" Type="String" />
                        <asp:Parameter Name="original_about_image2" Type="String" />
                        <asp:Parameter Name="original_about_image3" Type="String" />
                        <asp:Parameter Name="original_about_image3" Type="String" />
                        <asp:Parameter Name="original_about_image4" Type="String" />
                        <asp:Parameter Name="original_about_image4" Type="String" />
                        <asp:Parameter Name="original_about_image5" Type="String" />
                        <asp:Parameter Name="original_about_image5" Type="String" />
                        <asp:Parameter Name="original_about_image6" Type="String" />
                        <asp:Parameter Name="original_about_image6" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="ID" Type="Int32" />
                        <asp:Parameter Name="about_website" Type="String" />
                        <asp:Parameter Name="contact_website" Type="String" />
                        <asp:Parameter Name="about_image1" Type="String" />
                        <asp:Parameter Name="about_image2" Type="String" />
                        <asp:Parameter Name="about_image3" Type="String" />
                        <asp:Parameter Name="about_image4" Type="String" />
                        <asp:Parameter Name="about_image5" Type="String" />
                        <asp:Parameter Name="about_image6" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="about_website" Type="String" />
                        <asp:Parameter Name="contact_website" Type="String" />
                        <asp:Parameter Name="about_image1" Type="String" />
                        <asp:Parameter Name="about_image2" Type="String" />
                        <asp:Parameter Name="about_image3" Type="String" />
                        <asp:Parameter Name="about_image4" Type="String" />
                        <asp:Parameter Name="about_image5" Type="String" />
                        <asp:Parameter Name="about_image6" Type="String" />
                        <asp:Parameter Name="original_ID" Type="Int32" />
                        <asp:Parameter Name="original_about_website" Type="String" />
                        <asp:Parameter Name="original_about_website" Type="String" />
                        <asp:Parameter Name="original_contact_website" Type="String" />
                        <asp:Parameter Name="original_contact_website" Type="String" />
                        <asp:Parameter Name="original_about_image1" Type="String" />
                        <asp:Parameter Name="original_about_image1" Type="String" />
                        <asp:Parameter Name="original_about_image2" Type="String" />
                        <asp:Parameter Name="original_about_image2" Type="String" />
                        <asp:Parameter Name="original_about_image3" Type="String" />
                        <asp:Parameter Name="original_about_image3" Type="String" />
                        <asp:Parameter Name="original_about_image4" Type="String" />
                        <asp:Parameter Name="original_about_image4" Type="String" />
                        <asp:Parameter Name="original_about_image5" Type="String" />
                        <asp:Parameter Name="original_about_image5" Type="String" />
                        <asp:Parameter Name="original_about_image6" Type="String" />
                        <asp:Parameter Name="original_about_image6" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>

                <div class="row-fluid">
                    <%--<script>
                        $(document).ready(function () {

                            document.getElementById('<%=fl1.ClientID%>').onchange = function () {
                                document.getElementById('<%=txtfl1.ClientID%>').value = this.value;
                            }
                            document.getElementById('<%=fl2.ClientID()%>').onchange = function () {
                                document.getElementById('<%=txtfl2.ClientID()%>').value = this.value;
                            }
                            document.getElementById('<%=fl3.ClientID()%>').onchange = function () {
                                document.getElementById('<%=txtfl3.ClientID()%>').value = this.value;
                            }
                            document.getElementById('<%=fl4.ClientID()%>').onchange = function () {
                                document.getElementById('<%=txtfl4.ClientID()%>').value = this.value;
                            }
                            document.getElementById('<%=fl5.ClientID()%>').onchange = function () {
                                document.getElementById('<%=txtfl5.ClientID()%>').value = this.value;
                            }
                            document.getElementById('<%=fl6.ClientID()%>').onchange = function () {
                                document.getElementById('<%=txtfl6.ClientID()%>').value = this.value;
                            }
                        });


                    </script>--%>
                    <table class="table">
                        <tr>
                            <th colspan="4" class="td-head"><span class="spanhead">Edit Record
                                <asp:Button ID="Button1" runat="server" Text="Edit" CssClass="button" Style="width: 70px; margin-left: 50px;" OnClick="Button1_Click" />&nbsp;<asp:Button ID="btncancel" runat="server" Text="Cancel" Width="80" CssClass="button" OnClick="btncancel_Click" />&nbsp;<asp:Button ID="Button2" runat="server" Height="36px" Text="Return to Main Menu" PostBackUrl="~/Account/Admininput.aspx" CssClass="button" /></span></th>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:HiddenField ID="hdf" runat="server" />
                                <asp:Label ID="Label9" runat="server" Text="About Website"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:TextBox ID="about_website" runat="server" CssClass="textarea" TextMode="MultiLine" Rows="3"></asp:TextBox></td>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label10" runat="server" Text="Contact Website"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:TextBox ID="contact_website" runat="server" CssClass="textarea" TextMode="MultiLine" Rows="3"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label3" runat="server" Text="About Image 1 "></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:Label ID="about_image1" runat="server" ></asp:Label>
                                <asp:TextBox ID="txtfl1" CssClass="textbox" Enabled="false" runat="server"></asp:TextBox>
                                <div class="fileUpload btn btn-primary" id="divfl1" runat="server">
                                    <span style="margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;">Upload</span>
                                    <asp:FileUpload ID="fl1" runat="server" Width="50" CssClass="upload" onchange="return GetFile()" />

                                </div>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" ControlToValidate="fl1"
                                    SetFocusOnError="True" ValidationGroup="add" CssClass="txt-red" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="file not supported..." ValidationExpression="^.+(.jpeg|.JPEG.png|.PNG|.bmp|.BMP|.jpg|.JPG|.gif|.GIF)$"></asp:RegularExpressionValidator>
                            </td>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label4" runat="server" Text="About Image 2"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:Label ID="about_image2" runat="server" ></asp:Label>
                                <asp:TextBox ID="txtfl2" CssClass="textbox" Enabled="false" runat="server"></asp:TextBox>
                                <div class="fileUpload btn btn-primary" id="divfl2" runat="server">
                                    <span style="margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;">Upload</span>
                                    <asp:FileUpload ID="fl2" runat="server" Width="50" CssClass="upload" onchange="return GetFile2()"/>
                                </div>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="fl2"
                                    SetFocusOnError="True" ValidationGroup="add" CssClass="txt-red" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="file not supported..." ValidationExpression="^.+(.jpeg|.JPEG.png|.PNG|.bmp|.BMP|.jpg|.JPG|.gif|.GIF)$"></asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label5" runat="server" Text="About Image 3"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:Label ID="about_image3" runat="server" ></asp:Label>
                                <asp:TextBox ID="txtfl3" CssClass="textbox" Enabled="false" runat="server"></asp:TextBox>
                                <div class="fileUpload btn btn-primary" id="divfl3" runat="server">
                                    <span style="margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;">Upload</span>
                                    <asp:FileUpload ID="fl3" runat="server" Width="50" CssClass="upload" onchange="return GetFile3()" />
                                </div>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="fl3"
                                    SetFocusOnError="True" ValidationGroup="add" CssClass="txt-red" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="file not supported..." ValidationExpression="^.+(.jpeg|.JPEG.png|.PNG|.bmp|.BMP|.jpg|.JPG|.gif|.GIF)$"></asp:RegularExpressionValidator>
                            </td>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label6" runat="server" Text="About Image 4"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:Label ID="about_image4" runat="server" ></asp:Label>
                                <asp:TextBox ID="txtfl4" CssClass="textbox" Enabled="false" runat="server"></asp:TextBox>
                                <div class="fileUpload btn btn-primary" id="divfl4" runat="server">
                                    <span style="margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;">Upload</span>
                                    <asp:FileUpload ID="fl4" runat="server" Width="50" CssClass="upload" onchange="return GetFile4()" />
                                </div>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="fl4"
                                    SetFocusOnError="True" ValidationGroup="add" CssClass="txt-red" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="file not supported..." ValidationExpression="^.+(.jpeg|.JPEG.png|.PNG|.bmp|.BMP|.jpg|.JPG|.gif|.GIF)$"></asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label7" runat="server" Text="About Image 5"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:Label ID="about_image5" runat="server" ></asp:Label>
                                <asp:TextBox ID="txtfl5" CssClass="textbox" Enabled="false" runat="server"></asp:TextBox>
                                <div class="fileUpload btn btn-primary" id="divfl5" runat="server">
                                    <span style="margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;">Upload</span>
                                    <asp:FileUpload ID="fl5" runat="server" Width="50" CssClass="upload" onchange="return GetFile5()"/>
                                </div>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="fl5"
                                    SetFocusOnError="True" ValidationGroup="add" CssClass="txt-red" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="file not supported..." ValidationExpression="^.+(.jpeg|.JPEG.png|.PNG|.bmp|.BMP|.jpg|.JPG|.gif|.GIF)$"></asp:RegularExpressionValidator>
                            </td>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label8" runat="server" Text="About Image 6"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:Label ID="about_image6" runat="server" ></asp:Label>
                                <asp:TextBox ID="txtfl6" CssClass="textbox" Enabled="false" runat="server"></asp:TextBox>
                                <div class="fileUpload btn btn-primary" id="divfl6" runat="server">
                                    <span style="margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;">Upload</span>
                                    <asp:FileUpload ID="fl6" runat="server" Width="50" CssClass="upload" onchange="return GetFile6()"/>
                                </div>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="fl6"
                                    SetFocusOnError="True" ValidationGroup="add" CssClass="txt-red" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="file not supported..." ValidationExpression="^.+(.jpeg|.JPEG.png|.PNG|.bmp|.BMP|.jpg|.JPG|.gif|.GIF)$"></asp:RegularExpressionValidator>
                            </td>
                        </tr>

                    </table>
                </div>


            </div>
        </ContentTemplate>
        <Triggers>
                <asp:PostBackTrigger ControlID="Button1"  />
            <asp:PostBackTrigger ControlID="GridView1" />
        </Triggers>
    </asp:UpdatePanel>

</asp:Content>
